package collention;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionOperDomo {
    public static void main(String[] args) {


        Collection c1 = new ArrayList();
        c1.add("java");
        c1.add("c++");
        c1.add(".net");
        System.out.println("C1:"+c1);

        Collection c2=new ArrayList();
        c2.add("android");
        c2.add("ios");
        c2.add("java");
        System.out.println("c2"+c2);
        c1.addAll(c2);
        System.out.println("C1"+c1);
        System.out.println("C2"+c2);
        boolean contains=c1.contains(c2);
        System.out.println("是否包含"+contains);

       /* c1.retainAll(c2);
        System.out.println("C1"+c1);
        System.out.println("C2"+c2);*/
        c1.removeAll(c2);
        System.out.println("C1"+c1);
        System.out.println("c2"+c2);
    }
}